import React from 'react';

import {
  View,
  TouchableOpacity,
} from 'react-native';

import BaseComponent from './BaseComponent';
import SizeUtils from '../../common/SizeUtils';
import TPicker from '../../components/TPicker';

export default class CommponPickerView extends BaseComponent {
  constructor(props) {
    super(props);
  }

  render() {
    return(
      <TouchableOpacity style={{position:"absolute", top:0,
        width:SizeUtils.getWindowSize().width,
        height:SizeUtils.getWindowSize().height,
        backgroundColor:"#00000011"}} onPress={this._onPress.bind(this)}>
        <TPicker pickerData={this.props.pickerData} pickerData2={this.props.pickerData2} extends1={this.props.extends1} extends2={this.props.extends2} onClose={this._onPickerClose.bind(this)}
          type={this.props.type}/>
      </TouchableOpacity>
    )
  }

  _onPickerClose(selectedValue,selectedValue1) {
    this.props.onClose(selectedValue,selectedValue1);
  }

  _onPress() {
    this.props.onClose();
  }
}
